Make test less brittle prior to assert_eq failure message format change
authorSquirrel <gilescope@gmail.com>
Fri, 16 Jun 2017 18:20:41 +0000 (19:20 +0100)
committerMarc-Antoine Perennou <Marc-Antoine@Perennou.com>
Sat, 1 Jul 2017 18:36:30 +0000 (20:36 +0200)
PR #42541 on Rust is to make assert_eq error message be multi-line. Before implementing this we need to make the current test less brittle.

tests/bench.rs

index d8043c7d70f85819fb813a25bcb443af9a83eb26..f536eb3d2f93a98cd4bda0b7be58a9d77a026365 100644 (file)
@@ -242,10 +242,10 @@ fn cargo_bench_failing_test() {
 [FINISHED] release [optimized] target(s) in [..]
 [RUNNING] target[/]release[/]deps[/]foo-[..][EXE]
 thread '[..]' panicked at 'assertion failed: \
-    `(left == right)` (left: \
-    `\"hello\"`, right: `\"nope\"`)', src[/]foo.rs:14
-[..]
-", p.url()))
+    `(left == right)`", p.url()))
+                       .with_stderr_contains("left: `\"hello\"`")
+                       .with_stderr_contains("right: `\"nope\"`")
+                       .with_stderr_contains("src[/]foo.rs:14")
                        .with_status(101));
 }